<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <!--如果想在工具栏加入更多按钮，可以使用插槽方式， slot = 'left' or 'right'-->
      <crudOperation :permission="permission" />
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
          <el-form-item label="减压前地面血氧饱和(%)">
            <el-input v-model="form.jyqdmXybh" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压前地面心率(次/分)">
            <el-input v-model="form.jyqdmXl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压前地面呼吸(次/分)">
            <el-input v-model="form.jyqdmHx" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压前地面血压(mmHg)">
            <el-input v-model="form.jyqdmXy" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压前地面心电图">
            <el-input v-model="form.jyqdmXdt" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压前2500m血氧饱和(%)">
            <el-input v-model="form.jyq2500Xybh" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压前2500m心率(次/分)">
            <el-input v-model="form.jyq2500Xl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压前2500m呼吸(次/分)">
            <el-input v-model="form.jyq2500Hx" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压前2500m血压(mmHg)">
            <el-input v-model="form.jyq2500Xy" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压前2500m心电图">
            <el-input v-model="form.jyq2500Xdt" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压5500m血氧饱和">
            <el-input v-model="form.jy5500Xybh" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压5500m心率">
            <el-input v-model="form.jy5500Xl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压5500m呼吸">
            <el-input v-model="form.jy5500Hx" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压5500m血压">
            <el-input v-model="form.jy5500Xy" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压5500m心电图">
            <el-input v-model="form.jy5500Xdt" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后2500m血氧饱和">
            <el-input v-model="form.jyh2500Xybh" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后2500m心率">
            <el-input v-model="form.jyh2500Xl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后2500m呼吸">
            <el-input v-model="form.jyh2500Hx" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后2500m血压">
            <el-input v-model="form.jyh2500Xy" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后2500m心电图">
            <el-input v-model="form.jyh2500Xdt" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后1分钟血氧饱和">
            <el-input v-model="form.jyh1mXybh" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后1分钟心率">
            <el-input v-model="form.jyh1mXl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后1分钟呼吸">
            <el-input v-model="form.jyh1mHx" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后1分钟血压">
            <el-input v-model="form.jyh1mXy" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后1分钟心电图">
            <el-input v-model="form.jyh1mXdt" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后地面血氧饱和(%)">
            <el-input v-model="form.jyhdmXybh" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后地面心率(次/分)">
            <el-input v-model="form.jyhdmXl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后地面呼吸(次/分)">
            <el-input v-model="form.jyhdmHx" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后地面血压(mmHg)">
            <el-input v-model="form.jyhdmXy" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="减压后地面心电图">
            <el-input v-model="form.jyhdmXdt" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="结果判定(0:优秀,1:良好,2:合格,3:不合格)">
            <el-input v-model="form.jg" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="建议">
            <el-input v-model="form.jy" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="记录日期">
            <el-date-picker v-model="form.date" type="datetime" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="记录人">
            <el-input v-model="form.createBy" style="width: 370px;" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="text" @click="crud.cancelCU">取消</el-button>
          <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="jyqdmXybh" label="减压前地面血氧饱和(%)" />
        <el-table-column prop="jyqdmXl" label="减压前地面心率(次/分)" />
        <el-table-column prop="jyqdmHx" label="减压前地面呼吸(次/分)" />
        <el-table-column prop="jyqdmXy" label="减压前地面血压(mmHg)" />
        <el-table-column prop="jyqdmXdt" label="减压前地面心电图" />
        <el-table-column prop="jyq2500Xybh" label="减压前2500m血氧饱和(%)" />
        <el-table-column prop="jyq2500Xl" label="减压前2500m心率(次/分)" />
        <el-table-column prop="jyq2500Hx" label="减压前2500m呼吸(次/分)" />
        <el-table-column prop="jyq2500Xy" label="减压前2500m血压(mmHg)" />
        <el-table-column prop="jyq2500Xdt" label="减压前2500m心电图" />
        <el-table-column prop="jy5500Xybh" label="减压5500m血氧饱和" />
        <el-table-column prop="jy5500Xl" label="减压5500m心率" />
        <el-table-column prop="jy5500Hx" label="减压5500m呼吸" />
        <el-table-column prop="jy5500Xy" label="减压5500m血压" />
        <el-table-column prop="jy5500Xdt" label="减压5500m心电图" />
        <el-table-column prop="jyh2500Xybh" label="减压后2500m血氧饱和" />
        <el-table-column prop="jyh2500Xl" label="减压后2500m心率" />
        <el-table-column prop="jyh2500Hx" label="减压后2500m呼吸" />
        <el-table-column prop="jyh2500Xy" label="减压后2500m血压" />
        <el-table-column prop="jyh2500Xdt" label="减压后2500m心电图" />
        <el-table-column prop="jyh1mXybh" label="减压后1分钟血氧饱和" />
        <el-table-column prop="jyh1mXl" label="减压后1分钟心率" />
        <el-table-column prop="jyh1mHx" label="减压后1分钟呼吸" />
        <el-table-column prop="jyh1mXy" label="减压后1分钟血压" />
        <el-table-column prop="jyh1mXdt" label="减压后1分钟心电图" />
        <el-table-column prop="jyhdmXybh" label="减压后地面血氧饱和(%)" />
        <el-table-column prop="jyhdmXl" label="减压后地面心率(次/分)" />
        <el-table-column prop="jyhdmHx" label="减压后地面呼吸(次/分)" />
        <el-table-column prop="jyhdmXy" label="减压后地面血压(mmHg)" />
        <el-table-column prop="jyhdmXdt" label="减压后地面心电图" />
        <el-table-column prop="jg" label="结果判定(0:优秀,1:良好,2:合格,3:不合格)" />
        <el-table-column prop="jy" label="建议" />
        <el-table-column prop="date" label="记录日期" />
        <el-table-column prop="createBy" label="记录人" />
        <el-table-column v-if="checkPer(['admin','trainDycxsjy:edit','trainDycxsjy:del'])" label="操作" width="150px" align="center">
          <template slot-scope="scope">
            <udOperation
              :data="scope.row"
              :permission="permission"
            />
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>

<script>
import crudTrainDycxsjy from '@/api/trainDycxsjy'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'

const defaultForm = { id: null, trainId: null, jyqdmXybh: null, jyqdmXl: null, jyqdmHx: null, jyqdmXy: null, jyqdmXdt: null, jyq2500Xybh: null, jyq2500Xl: null, jyq2500Hx: null, jyq2500Xy: null, jyq2500Xdt: null, jy5500Xybh: null, jy5500Xl: null, jy5500Hx: null, jy5500Xy: null, jy5500Xdt: null, jyh2500Xybh: null, jyh2500Xl: null, jyh2500Hx: null, jyh2500Xy: null, jyh2500Xdt: null, jyh1mXybh: null, jyh1mXl: null, jyh1mHx: null, jyh1mXy: null, jyh1mXdt: null, jyhdmXybh: null, jyhdmXl: null, jyhdmHx: null, jyhdmXy: null, jyhdmXdt: null, jg: null, jy: null, date: null, createBy: null, trainItemId: null }
export default {
  name: 'TrainDycxsjy',
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '低压舱迅速减压体验', url: 'api/trainDycxsjy', idField: 'id', sort: 'id,desc', crudMethod: { ...crudTrainDycxsjy }})
  },
  data() {
    return {
      permission: {
        add: ['admin', 'trainDycxsjy:add'],
        edit: ['admin', 'trainDycxsjy:edit'],
        del: ['admin', 'trainDycxsjy:del']
      },
      rules: {
      }    }
  },
  methods: {
    // 钩子：在获取表格数据之前执行，false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }
  }
}
</script>

<style scoped>

</style>
